using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Web;
using System.Web.Services;

namespace Dimok.User {

	////////////////////////////////////////////////////////////////////////////////////////////////////
	/// <summary>	Ws. </summary>
	///
	/// <remarks>	Dimon, 12/21/2010. </remarks>
	////////////////////////////////////////////////////////////////////////////////////////////////////

	public class WS : System.Web.Services.WebService {

		////////////////////////////////////////////////////////////////////////////////////////////////////
		/// <summary>	Default constructor. </summary>
		///
		/// <remarks>	Dimon, 12/21/2010. </remarks>
		////////////////////////////////////////////////////////////////////////////////////////////////////

		public WS() {
			//CODEGEN: This call is required by the ASP.NET Web Services Designer
			InitializeComponent();
		}

		#region Component Designer generated code
		
		//Required by the Web Services Designer 
		private IContainer components = null;

		////////////////////////////////////////////////////////////////////////////////////////////////////
		/// <summary>	
		/// Required method for Designer support - do not modify the contents of this method with the code
		/// editor. 
		/// </summary>
		///
		/// <remarks>	Dimon, 12/21/2010. </remarks>
		////////////////////////////////////////////////////////////////////////////////////////////////////

		private void InitializeComponent() {
		}

		////////////////////////////////////////////////////////////////////////////////////////////////////
		/// <summary>	Clean up any resources being used. </summary>
		///
		/// <remarks>	Dimon, 12/21/2010. </remarks>
		///
		/// <param name="disposing">	true if resources should be disposed, false if not. </param>
		////////////////////////////////////////////////////////////////////////////////////////////////////

		protected override void Dispose( bool disposing ) {
			if(disposing && components != null) {
				components.Dispose();
			}
			base.Dispose(disposing);		
		}
		
		#endregion

		////////////////////////////////////////////////////////////////////////////////////////////////////
		/// <summary>	Creates a company. </summary>
		///
		/// <remarks>	Dimon, 12/21/2010. </remarks>
		///
		/// <exception cref="ASPException">	Thrown when asp. </exception>
		///
		/// <param name="companyName">		Name of the company. </param>
		/// <param name="adminName">			Name of the admin. </param>
		/// <param name="adminPassword">	The admin password. </param>
		////////////////////////////////////////////////////////////////////////////////////////////////////

		[WebMethod]
		public void CreateCompany(string companyName,string adminName,string adminPassword){
			try{
				UserObject uox = new UserObject();
				uox.CreateCompany("PreQual",companyName,adminName,adminPassword);
			}catch(Exception exc){throw new Dimok.Exceptions.ASPException(exc);}
		}
	}
}
